﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Traceability_Management.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class 读取21 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Rabit_id",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Rabit_Id",
                table: "Processiings");

            migrationBuilder.DropColumn(
                name: "ConnectionId",
                table: "ImgModel");

            migrationBuilder.DropColumn(
                name: "Farming_Id",
                table: "ImgModel");

            migrationBuilder.DropColumn(
                name: "Rabit_id",
                table: "Farmings");

            migrationBuilder.RenameColumn(
                name: "Slaught_batch",
                table: "Slaughts",
                newName: "Slaught_Batch");

            migrationBuilder.RenameColumn(
                name: "Slaught_Companyimg",
                table: "Slaughts",
                newName: "Rabit_Batch");

            migrationBuilder.RenameColumn(
                name: "Slaught_Company",
                table: "Slaughts",
                newName: "Companyimg");

            migrationBuilder.RenameColumn(
                name: "InTable_Id",
                table: "ImgModel",
                newName: "Img_Cout");

            migrationBuilder.AlterColumn<DateTime>(
                name: "Slaught_Time",
                table: "Slaughts",
                type: "datetime(6)",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)");

            migrationBuilder.AlterColumn<DateTime>(
                name: "Slaught_ActionTime",
                table: "Slaughts",
                type: "datetime(6)",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)");

            migrationBuilder.AddColumn<string>(
                name: "Company",
                table: "Slaughts",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Company_Content",
                table: "Slaughts",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Company_Path",
                table: "Slaughts",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<DateTime>(
                name: "Company_Time",
                table: "Slaughts",
                type: "datetime(6)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Rabit_Batch",
                table: "Processiings",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Page_Id",
                table: "ImgModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Rabit_Batch",
                table: "ImgModel",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<string>(
                name: "Rabit_Batch",
                table: "Farmings",
                type: "longtext",
                nullable: false)
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Company",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Company_Content",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Company_Path",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Company_Time",
                table: "Slaughts");

            migrationBuilder.DropColumn(
                name: "Rabit_Batch",
                table: "Processiings");

            migrationBuilder.DropColumn(
                name: "Page_Id",
                table: "ImgModel");

            migrationBuilder.DropColumn(
                name: "Rabit_Batch",
                table: "ImgModel");

            migrationBuilder.DropColumn(
                name: "Rabit_Batch",
                table: "Farmings");

            migrationBuilder.RenameColumn(
                name: "Slaught_Batch",
                table: "Slaughts",
                newName: "Slaught_batch");

            migrationBuilder.RenameColumn(
                name: "Rabit_Batch",
                table: "Slaughts",
                newName: "Slaught_Companyimg");

            migrationBuilder.RenameColumn(
                name: "Companyimg",
                table: "Slaughts",
                newName: "Slaught_Company");

            migrationBuilder.RenameColumn(
                name: "Img_Cout",
                table: "ImgModel",
                newName: "InTable_Id");

            migrationBuilder.AlterColumn<DateTime>(
                name: "Slaught_Time",
                table: "Slaughts",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldNullable: true);

            migrationBuilder.AlterColumn<DateTime>(
                name: "Slaught_ActionTime",
                table: "Slaughts",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                oldClrType: typeof(DateTime),
                oldType: "datetime(6)",
                oldNullable: true);

            migrationBuilder.AddColumn<int>(
                name: "Rabit_id",
                table: "Slaughts",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "Rabit_Id",
                table: "Processiings",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "ConnectionId",
                table: "ImgModel",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "Farming_Id",
                table: "ImgModel",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "Rabit_id",
                table: "Farmings",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }
    }
}
